//公告的请求封装
import request from "@/utils/http.ts"

//1.添加公告
export const addBulletinAPI = (data: any) => {
    return request({
        url: 'bulletin/addBulletin',
        method: 'post',
        data: {
            bulletinStatus: data.bulletinStatus,
            bulletinTitle: data.bulletinTitle,
            bulletinText: data.bulletinText,
            bulletinCreateName: data.bulletinCreateName,
        }
    })
}

//2.更新公告
export const updateBulletinAPI = (data: any) => {
    return request({
        url: 'bulletin/updateBulletin',
        method: 'post',
        data: {
            bulletinId: data.bulletinId,
            bulletinStatus: data.bulletinStatus,
            bulletinTitle: data.bulletinTitle,
            bulletinText: data.bulletinText,
        }
    })
}

//3.删除公告
export const deleteBulletinAPI = (data: any) => {
    return request({
        url: 'bulletin/deleteBulletin',
        method: 'post',
        params: {
            bulletinId: data.bulletinId,
        }
    })
}

//4.分页获取公告
export const pageBulletinAPI = (data: any) => {
    return request({
        url: 'bulletin/pageBulletin',
        method: 'post',
        data: {
            bulletinStatus: data.bulletinStatus,
            bulletinTitle: data.bulletinTitle,
            pageCurrent: data.pageCurrent,
            pageSize: data.pageSize,
        }
    })
}

//5.获取公告详情
export const getBulletinDetailAPI = (data: any) => {
    return request({
        url: 'bulletin/getBulletinDetail',
        method: 'post',
        params: {
            bulletinId: data.bulletinId,
        }
    })
}
